/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "TYPEJO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Typejo.findAll", query = "SELECT t FROM Typejo t"),
    @NamedQuery(name = "Typejo.findByIdTypejo", query = "SELECT t FROM Typejo t WHERE t.idTypejo = :idTypejo"),
    @NamedQuery(name = "Typejo.findByLibelletypejo", query = "SELECT t FROM Typejo t WHERE t.libelletypejo = :libelletypejo")})
public class Typejo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_TYPEJO")
    private Integer idTypejo;
    @Basic(optional = false)
    @Column(name = "LIBELLETYPEJO")
    private String libelletypejo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "typejo")
    private Collection<Journaux> journauxCollection;

    public Typejo() {
    }

    public Typejo(Integer idTypejo) {
        this.idTypejo = idTypejo;
    }

    public Typejo(Integer idTypejo, String libelletypejo) {
        this.idTypejo = idTypejo;
        this.libelletypejo = libelletypejo;
    }

    public Integer getIdTypejo() {
        return idTypejo;
    }

    public void setIdTypejo(Integer idTypejo) {
        this.idTypejo = idTypejo;
    }

    public String getLibelletypejo() {
        return libelletypejo;
    }

    public void setLibelletypejo(String libelletypejo) {
        this.libelletypejo = libelletypejo;
    }

    @XmlTransient
    public Collection<Journaux> getJournauxCollection() {
        return journauxCollection;
    }

    public void setJournauxCollection(Collection<Journaux> journauxCollection) {
        this.journauxCollection = journauxCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTypejo != null ? idTypejo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Typejo)) {
            return false;
        }
        Typejo other = (Typejo) object;
        if ((this.idTypejo == null && other.idTypejo != null) || (this.idTypejo != null && !this.idTypejo.equals(other.idTypejo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Typejo[ idTypejo=" + idTypejo + " ]";
    }
    
}
